Repository navigation
Add opt-in live model API smoke tests - #537
Merged
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Continue the implementation from #430 with process-isolated live tests, explicit configuration failures, offline HTTP regression coverage, and usage documentation. Co-authored-by: mikemikimike <13286568797@163.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The review identifies no active issues with the opt-in live API smoke-testing changes.
No open issues 🎉
What changed in this PR
Adds opt-in live API smoke testing to TypeChat’s TypeScript suite, continuing #430 toward resolving #328 while keeping mocked regression tests unconditional and hosted requests disabled by default.
Changes:
- Adds a process-isolated smoke test for OpenAI Chat Completions, Responses, and Azure OpenAI, enabled only by
TYPECHAT_LIVE_TESTS=1. - Limits live requests to 30 seconds with no retries and fails visibly on missing configuration, request errors, or blank completions.
- Adds offline loopback regression coverage and documents configuration, provider charges, and PowerShell usage.
| File | Description |
|---|---|
typescript/tests/model.test.mjs |
Restores native fetch after mocked tests. |
typescript/tests/model-live.test.mjs |
Adds the gated live smoke test using the existing model factory. |
typescript/tests/model-live-runner.test.mjs |
Verifies gating, provider routing, isolation, failures, and timeouts with loopback fixtures. |
typescript/README.md |
Documents live-test setup, safeguards, and expected behavior. |
Review effort: Balanced
Curtis Man (curtisman)
approved these changes
Nov 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #328. Continues mikemikimike's implementation from the closed, unmerged #430.
TYPECHAT_LIVE_TESTS=1for the separate, process-isolated live smoke test.Contributor credit
The first two commits preserve mikemikimike's original author metadata from #430:
The follow-up commit also includes their co-author attribution. Please retain contributor attribution if squash-merging.
Validation
Using the pinned Node.js 24.22.1 runtime:
npm test: 422 passed, 0 failed; the real-provider suite remains disabled by default.Additional owner-requested online/offline verification
Using Node.js 24.22.1 against the same PR head:
npm test, with live provider calls disabled: 422 passed, 0 failed.npm test: 423 passed, 0 failed, including a real completion against the owner-selected Azuregpt_4_1deployment using identity authentication.fetch failedtransport error. Endpoint reachability checks, an isolated live rerun, and the complete live-enabled rerun subsequently passed. No source, timeout, or retry settings were changed to obtain passing results.The verification used the same DefaultAzureCredential flow as TypeAgent, backed by existing Azure CLI authentication. The short-lived bearer token was passed only through the test process environment; no credentials or private endpoint details were written to repository configuration, committed, or included in this PR.